<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>PROJEKT Z PRZEDMIOTU SYSTEMY KOMPUTEROWE (SYKO) grupa nr. 16: Opis działania funkcji CPSE</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Wygenerowano przez Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Szukaj');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PROJEKT Z PRZEDMIOTU SYSTEMY KOMPUTEROWE (SYKO) grupa nr. 16&#160;<span id="projectnumber">0.01</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Strona&#160;główna</span></a></li>
      <li class="current"><a href="pages.html"><span>Dodatkowe&#160;strony</span></a></li>
      <li><a href="modules.html"><span>Moduły</span></a></li>
      <li><a href="files.html"><span>Pliki</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Szukaj" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">Opis działania funkcji CPSE </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>CPSE - funkcja wykonująca skok jeśli wartość dwóch danych rejestrów jest sobie równa.</p>
<h2><a class="anchor" id="sec_cpse1"></a>
Wykonywane operacje</h2>
<p>1. Identyfikacja numeru rejestru arg. 1: <div class="fragment"><pre class="fragment">        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rd=(getMEMC(getPC()) &amp; 0x00F0) &gt;&gt; 4;                    <span class="comment">//Identyfikacja numeru rejestru arg. 1</span>
</pre></div> 2. Identyfikacja numeru rejestru arg. 2: <div class="fragment"><pre class="fragment">        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rr=(getMEMC(getPC()) &amp; 0x000F);                         <span class="comment">//Identyfikacja numeru rejestru arg. 2</span>
</pre></div> 3. Pobranie zawartosci rejestru arg 1: <div class="fragment"><pre class="fragment">        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rd_val = getRegister(Rd) % <a class="code" href="group__maxi.html#ga6125be368b2b4d2026c291477eab8c76" title="Maksymalna wartosc.">MAX_DATA_VAL</a>;                <span class="comment">//Pobranie zawartosci rejestru arg 1</span>
</pre></div> 4. Pobranie zawartosci rejestru arg 2: <div class="fragment"><pre class="fragment">        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rr_val = getRegister(Rr) % <a class="code" href="group__maxi.html#ga6125be368b2b4d2026c291477eab8c76" title="Maksymalna wartosc.">MAX_DATA_VAL</a>;                <span class="comment">//Pobranie zawartosci rejestru arg 2</span>
</pre></div> 5.Sprawdzenie warunku równości, jeśli prawda do skok o ustalone k, jeśli fałsz to skok o 1: <div class="fragment"><pre class="fragment">        <span class="keywordflow">if</span>(Rd_val == Rr_val) incPC_k(1);
        <span class="keywordflow">else</span> incPC();
</pre></div></p>
<h2><a class="anchor" id="sec_cpse2"></a>
Kod źródłowy funkcji</h2>
<div class="fragment"><pre class="fragment"><span class="comment">/*</span>
<span class="comment">================================================================================</span>
<span class="comment">        Plik: f_cpse.c</span>
<span class="comment">--------------------------------------------------------------------------------</span>
<span class="comment">        Autorzy: Piotr Zdunek, Mateusz Słowikowski, Krzysztof Wiąckowski</span>
<span class="comment">        Projekt:Model mikrokontrolera AVR</span>
<span class="comment">        Kompilator: avr-gcc-4.3.5</span>
<span class="comment">        Doc: doxygen 1.7.4</span>
<span class="comment">--------------------------------------------------------------------------------</span>
<span class="comment">        Zawiera:</span>
<span class="comment">--------------------------------------------------------------------------------</span>
<span class="comment">        Komentarze:</span>
<span class="comment">================================================================================</span>
<span class="comment">*/</span>

<span class="preprocessor">#include &quot;<a class="code" href="types_8h.html" title="Biblioteka typów.">types.h</a>&quot;</span>
<span class="preprocessor">#include &quot;mem_abs.h&quot;</span>

<span class="comment">//**********************************************</span>
<span class="comment">//CPSE - funkcja wykonująca skok jeśli wartość dwóch danych rejestrów jest sobie równa</span>
<span class="comment">//**************************************************</span>

<span class="keywordtype">void</span> <a class="code" href="f__cpse_8c.html#ab8bf17fd972dea01f6af341b72ccc9c2">F_CPSE</a>(<span class="keywordtype">void</span>){

<span class="preprocessor">        #if DEBUG_MODE</span>
<span class="preprocessor"></span>                printf(<span class="stringliteral">&quot;Function CPSE.&quot;</span>);
<span class="preprocessor">        #endif</span>
<span class="preprocessor"></span>        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rd=(getMEMC(getPC()) &amp; 0x00F0) &gt;&gt; 4;                    <span class="comment">//Identyfikacja numeru rejestru arg. 1</span>
        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rr=(getMEMC(getPC()) &amp; 0x000F);                         <span class="comment">//Identyfikacja numeru rejestru arg. 2</span>
        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rd_val = getRegister(Rd) % <a class="code" href="group__maxi.html#ga6125be368b2b4d2026c291477eab8c76" title="Maksymalna wartosc.">MAX_DATA_VAL</a>;                <span class="comment">//Pobranie zawartosci rejestru arg 1</span>
        <a class="code" href="group__typy.html#ga3007400364f103d0c02f0838d05a0504" title="osmiobitowy typ danych o wartosciach od 0 do 255.">uint8_t</a> Rr_val = getRegister(Rr) % <a class="code" href="group__maxi.html#ga6125be368b2b4d2026c291477eab8c76" title="Maksymalna wartosc.">MAX_DATA_VAL</a>;                <span class="comment">//Pobranie zawartosci rejestru arg 2</span>

<span class="preprocessor">        #if DEBUG_MODE</span>
<span class="preprocessor"></span>                printf(<span class="stringliteral">&quot;Rd %d Rr %d\n&quot;</span>,Rd_val,Rr_val);
                printf(<span class="stringliteral">&quot;PC = %d\n&quot;</span>,getPC());
<span class="preprocessor">        #endif</span>
<span class="preprocessor"></span><span class="comment">//Sprawdzenie warunku równości</span>
<span class="comment">//jeśli prawda do skok o k</span>
<span class="comment">//jeśli fałsz to skok o 1</span>
        <span class="keywordflow">if</span>(Rd_val == Rr_val) incPC_k(1);
        <span class="keywordflow">else</span> incPC();

<span class="preprocessor">        #if DEBUG_MODE</span>
<span class="preprocessor"></span>                printf(<span class="stringliteral">&quot;PC = %d\n&quot;</span>,getPC());
<span class="preprocessor">        #endif</span>
<span class="preprocessor"></span>        <span class="comment">//TODO - spr. incPC w CPSE</span>
        <span class="comment">//incPC();</span>
}
</pre></div> </div></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Pliki</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Funkcje</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Definicje typów</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Definicje</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Wygenerowano Mon Jun 6 2011 20:13:46 dla PROJEKT Z PRZEDMIOTU SYSTEMY KOMPUTEROWE (SYKO) grupa nr. 16 programem&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
